package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject {

    private Long destId = -1L;//目的地

    private  int state = -1; //游记状态

    private int orderType = -1; //排序类型

    private int travelTimeType = -1;  //出发时间(月份)
    private TravelCondition travelTime;

    private int dayType = -1;   //旅游天数类型
    private TravelCondition days;

    private int perExpendType = -1;  //人均消费类型
    private TravelCondition perExpends;


    public String getOrderBy(){
        if (orderType == 1){
            return "t.createTime desc";//最新
        }
        else if (orderType == 2){
            return "t.viewnum desc";//最热
        }else {
            return "t.createTime desc";
        }
    }

    public TravelCondition getDays(){
        return TravelCondition.DAYS_MAP.get(dayType);
    }
    public TravelCondition getTravelTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }
    public TravelCondition getPerExpends(){
        return TravelCondition.TRAVEL_PRE_EXPENDS.get(perExpendType);
    }

}
